import pandas as pd


def frame_delete():
    data = {"name": {"one": "小明", "two": "小红", "three": "小蓝"},
            "age": {"one": 18, "two": 19, "three": 20},
            "height": {"one": 188, "two": 189, "three": 160}
            }
    frame = pd.DataFrame(data)
    # 删除单个数据
    frame.drop("one")  # 默认删除行
    frame.drop("height", axis=1)  # 想要删除列添加axis = 1
    frame.drop("two", inplace=True)
    print(frame)
    frame = pd.DataFrame(data)
    # 删除多个数据
    frame.drop(["one", "two"])  # 默认删除行
    frame.drop(["age", "height"], axis=1)  # 想要删除列添加axis = 1
    frame.drop(["one", "two"], inplace=True)  # 原地删除
    print(frame)


if __name__ == '__main__':
    frame_delete()
